symbols are a primitive data type introduced in ECMAScript 6 (ES6).
They are unique and immutable data types that can be used as property keys in objects. Unlike strings, symbols create unique keys, which helps avoid naming collisions in object properties.
Symbols are often used to add unique property keys to an object that won't collide with keys any other code might add to the object, and which are hidden from any mechanisms other code will typically use to access the object.
That enables a form of weak encapsulation or a weak form of information hiding
Every Symbol() call is guaranteed to return a unique Symbol.
Every Symbol.for('key') call will always return the same Symbol for a given value of 'key'. When Symbol.for('key') is called, if a Symbol with the given key can be found in the global Symbol registry, that Symbol is returned.
Otherwise, a new Symbol is created, added to the global Symbol registry under the given key, and returned.